import axios from '@/libs/api.request'

export const getGoodsList = ({pageId}) => {
  return axios.request({
    url: 'Goods/getGoodsList',
    data: {pageId},
    method: 'post'
  })
}


export const delGoods = (id) => {
  return axios.request({
    url: 'Goods/delGoods',
    data: {id},
    method: 'post'
  })
}

export const getGoodsDetail = (id) => {
  return axios.request({
    url: 'Goods/getGoodsDetail',
    data: {id},
    method: 'post'
  })
}

export const editGoods = ({ id, picture, title, subheading, scope, label, isHotProducts, content,amount }) => {
  const data = { id, picture, title, subheading, scope, label, isHotProducts, content,amount }
  return axios.request({
    url: 'Goods/editGoods',
    data: data,
    method: 'post'
  })
}
